;; The first four lines of this file were added by Dracula.
;; They tell DrScheme that this is a Dracula Modular ACL2 program.
;; Leave these lines unchanged so that DrScheme can properly load this file.
#reader(planet "reader.rkt" ("cce" "dracula.plt") "modular" "lang")
(require "Irng.lisp")

; Random Number Generator module
; Linear Congruential Generator, main function is to return a random number
; less than a given maximum
(module Mrng
  
  ; Input - A seed, integer
  ; Output - A new seed, integer
  (defun get-random-number (seed)
    (let ((modulo (expt 2 32))
          (multiplier 1103515245)
          (increment 12345)
         )
          (mod (+ (* multiplier seed) increment) modulo)
    )
  )
    
  ; Input - A seed, integer
  ;         A max, integer
  ; Output - A pair of the new seed and a number less than max
  (defun get-random-number-mod-max (seed max)
    (let ((new-seed (get-random-number seed))
         )
          (cons (mod new-seed max) new-seed)
    )
  )
  
  (export Irng)
)